package com.slz3.business.module.orderManagement.ordRefund.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.orderManagement.ordRefund.domain.OrdRefund;
import com.slz3.business.module.orderManagement.ordRefund.domain.OrdRefundCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class OrdRefundResController {

    static Mono<ServerResponse> add(ServerRequest req, OrdRefund ordRefund) {
        if (OrdRefundResUnsafeValid.add(req, ordRefund)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.add_$OrdRefundUpdateLock(req, ordRefund);
        }
    }

    static final Mono<ServerResponse> delete(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        if (OrdRefundResUnsafeValid.delete(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.delete_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

    static Mono<ServerResponse> modify(ServerRequest req, OrdRefund ordRefund) {
        if (OrdRefundResUnsafeValid.modify(req, ordRefund)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.modify_$OrdRefundUpdateLock(req, ordRefund);
        }
    }

    static Mono<ServerResponse> list(ServerRequest req) {
        if (OrdRefundResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResExecutor.list(req);
        }
    }

    static Mono<ServerResponse> info(ServerRequest req) {
        if (OrdRefundResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.info_$OrdRefundUpdateLock(req);
        }
    }

    static Mono<ServerResponse> choice(ServerRequest req) {
        if (OrdRefundResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResExecutor.choice(req);
        }
    }

    static final Mono<ServerResponse> auditSubmit(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        //
        if (OrdRefundResUnsafeValid.auditSubmit(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.auditSubmit_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

    static final Mono<ServerResponse> audit(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        if (OrdRefundResUnsafeValid.audit(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.audit_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

    static final Mono<ServerResponse> auditReject(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        if (OrdRefundResUnsafeValid.auditReject(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.auditReject_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

    static final Mono<ServerResponse> usingEnable(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        if (OrdRefundResUnsafeValid.usingEnable(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.usingEnable_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

    static final Mono<ServerResponse> usingDisable(ServerRequest req, OrdRefundCondition ordRefundCondition) {
        if (OrdRefundResUnsafeValid.usingDisable(req, ordRefundCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return OrdRefundResAtomic.usingDisable_$OrdRefundUpdateLock(req, ordRefundCondition);
        }
    }

}
